package com.example.demo.controller;

import com.example.demo.service.ThreadPool.AsyncService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 线程池控制器
 *
 * @author yzh
 * @date 2022/11/21
 */
@Controller
public class ThreadPoolController {
    @Autowired
    AsyncService asyncService;


    @RequestMapping("/async")
    @ResponseBody
    public void async() throws InterruptedException {
        asyncService.F1();
        asyncService.F2();
    }
}
